package com.tenchael.iblog;

import com.tenchael.iblog.web.filter.LoggingFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by tengzhizhang on 2017/12/24.
 */
@Configuration
public class WebConfiguration {

	@Bean
	public FilterRegistrationBean loggingFilterBean() {
		FilterRegistrationBean registration = new FilterRegistrationBean();
		registration.setFilter(new LoggingFilter());
		registration.addUrlPatterns("/*");
		registration.setName("LoggingFilter");
		registration.setOrder(1);
		return registration;
	}

}
